def file = new File("")
println file.path
println file.absolutePath
println file.toURI().toString()

// File list
println '-------------------------------------'
file = new File(file.absolutePath)
println "file list:" + file.list()
println "file list:" + file.list().toList()
println "file list:" + file.listFiles([accept: {d, f -> f ==~ /files\.groovy/ }] as FilenameFilter).toList()
println "file list:" + file.listFiles({d, f -> f ==~ /files\.groovy/ } as FilenameFilter).toList()

def list= []
file.eachFile{ list << it.name }
println "file list:" + list

// Create, delete, read and write file
println '-------------------------------------'
file = new File("files.tmp")
if (! file.exists()) {
	file.createNewFile()
}

file.write('123\n')
file.append('abc');file.append('cba')

list = []
file.eachLine{ list << it}
println list

file.delete()

